import hashlib
import time

import requests
from flask import jsonify

import untils

data = untils.get_r2_data()
data1 = untils.get_count()
# end_update_time, province, city, county, address, type
details = []
risk = []

end_update_time = data[0][0]
for a, b, c, d, e, f in data:
    risk.append(f)
    details.append(f"{b}\t{c}\t{d}\t{e}")

account1 = data1[0][1]
account2 = data1[0][2]
d= jsonify({"update_time": end_update_time, "details": details, "risk": risk, "acc1": account1,
                    "acc2": account2})
